refactor(snapshot): effectify SnapshotService#17878
Merged
kitlangton merged 2 commits intodevfrom Mar 18, 2026
Merged
Conversation
4 tasks
Convert Snapshot from a promise-based namespace with Instance ALS reads
to an Effect service on the Instances LayerMap.
- SnapshotService with ChildProcessSpawner for git subprocess execution
and Effect FileSystem for file operations (replaces Process.run and
raw fs calls)
- Nothrow git helper that always returns { code, text, stderr }, with
spawn failure details preserved in stderr
- Hourly cleanup via Effect.forkScoped + Schedule.spaced (replaces
Scheduler.register)
- Promise facade preserved for all existing callers
- Parallelized before/after git show in diffFull
- Add worktree to InstanceContext.Shape (needed for --work-tree flag)
- Add Instance.current getter for single ALS read
- Extract repeated git config flags into GIT_CORE/GIT_CFG/GIT_CFG_QUOTE
constants
- Platform layers (NodeChildProcessSpawner, NodeFileSystem, NodePath)
provided directly on the service layer
58ad84d to
ab89f84
Compare
3 tasks
AbhishekChorotiya
pushed a commit
to AbhishekChorotiya/opencode
that referenced
this pull request
Mar 19, 2026
AvatarGanymede
pushed a commit
to AvatarGanymede/opencode-dev
that referenced
this pull request
Mar 19, 2026
demostanis
pushed a commit
to demostanis/opencode
that referenced
this pull request
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Snapshotfrom a promise-based namespace with Instance ALS reads to an Effect service (SnapshotService) on the InstancesLayerMapChildProcessSpawnerfor git subprocess execution and EffectFileSystemfor file operations (replacesProcess.runand rawfscalls)Scheduler.registerwithEffect.forkScoped+Schedule.spacedfor hourly cleanupworktreetoInstanceContext.ShapeandInstance.currentgetterDetails
{ code, text, stderr }, preserving spawn failure detailsgit showindiffFullviaEffect.all({ concurrency: 2 })NodeChildProcessSpawner,NodeFileSystem,NodePath) provided directly on the service layerGIT_CORE/GIT_CFG/GIT_CFG_QUOTEconstantsTest plan
extendEnv: truedoesn't break git PATH resolution (behavioral difference from oldProcess.runenv handling)exists+mkdirintrack()doesn't cause issues vs old atomicfs.mkdirreturn value check